<%@ include file="/taglibs.jsp"%>
<%@ page contentType="text/html;charset=UTF-8" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script src="${js}/jquery-1.6.min.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" media="screen" href="${css}/screen.css" />
<title></title>
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
.STYLE1 {font-size: 12px}
.STYLE4 {
	font-size: 12px;
	color: #1F4A65;
	font-weight: bold;
}

a:link {
	font-size: 12px;
	color: #06482a;
	text-decoration: none;

}
a:visited {
	font-size: 12px;
	color: #06482a;
	text-decoration: none;
}
a:hover {
	font-size: 12px;
	color: #FF0000;
	text-decoration: underline;
}
a:active {
	font-size: 12px;
	color: #FF0000;
	text-decoration: none;
}
.STYLE7 {font-size: 12}

-->
</style>

<script>

var  highlightcolor='#eafcd5';
//此处clickcolor只能用win系统颜色代码才能成功,如果用#xxxxxx的代码就不行,还没搞清楚为什么:(
var  clickcolor='#51b2f6';
function  changeto(){
	source=event.srcElement;
	if  (source.tagName=="TR"||source.tagName=="TABLE")
	return;
	while(source.tagName!="TD")
	source=source.parentElement;
	source=source.parentElement;
	cs  =  source.children; 
	if  (cs[1].style.backgroundColor!=highlightcolor&&source.id!="nc"&&cs[1].style.backgroundColor!=clickcolor)
	for(i=0;i<cs.length;i++){
		cs[i].style.backgroundColor=highlightcolor;
	}
}

function  changeback(){
	if  (event.fromElement.contains(event.toElement)||source.contains(event.toElement)||source.id=="nc")
		return
	if  (event.toElement!=source&&cs[1].style.backgroundColor!=clickcolor)
	//source.style.backgroundColor=originalcolor
	for(i=0;i<cs.length;i++){
		cs[i].style.backgroundColor="";
	}
}

function  clickto(){
	source=event.srcElement;
	if  (source.tagName=="TR"||source.tagName=="TABLE")
	return;
	while(source.tagName!="TD")
	source=source.parentElement;
	source=source.parentElement;
	cs  =  source.children;
	if  (cs[1].style.backgroundColor!=clickcolor&&source.id!="nc")
		for(i=0;i<cs.length;i++){
			cs[i].style.backgroundColor=clickcolor;
		}
	else
		for(i=0;i<cs.length;i++){
			cs[i].style.backgroundColor="";
		}
}


function editMethod(id)
{
	var url = "${ctx}/custgroup/edit";
	if(id != "-1"){
		url = url+"?id="+id;
	}
	$('#sms-fms').attr('action',url);
	$('#sms-fms').submit();
}

function deleteMethod(id)
{
	$('#sms-fms').attr('action',"${ctx}/custgroup/del?id="+id);
	$('#sms-fms').submit();
}

function toPage(type)
{
  var url="${ctx}/custgroup/page";
  var pages = $('#page').val();
  var lastPages = $('#lastPage').val();
  if(type == "1")
  {
	  if(pages>1)
	  {
		  pages=pages-1;
	  }else
	  {
		  pages=1;
	   }
	  url=url+"?page="+pages;
  }else if(type == "2")
  {
	  pages=pages*1+1;
	  if(pages>lastPages)
	  {
		  pages = lastPages;
	  }
	  url=url+"?page="+pages;
  }else if(type == "3")
  {
	  url=url+"?page="+$('#lastPage').val();
  }
  $('#sms-fms').attr('action',url);
  $('#sms-fms').submit();
}
</script>
</head>
<body>
<form id="sms-fms" method="post">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="30"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="15" height="30"><img src="${img}/tab_03.gif" width="15" height="30" /></td>
        <td width="1101" background="${img}/tab_05.gif"><img src="${img}/311.gif" width="16" height="16" /> <span class="STYLE4">${title}</span></td>
        <td width="281" background="${img}/tab_05.gif"><table border="0" align="right" cellpadding="0" cellspacing="0">
        </table></td>
        <td width="14"><img src="${img}/tab_07.gif" width="14" height="30" /></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="9" background="${img}/tab_12.gif">&nbsp;</td>
        <td bgcolor="#f3ffe3"><table width="99%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#c0de98" onmouseover="changeto()"  onmouseout="changeback()">
          <tr>
            <td width="5%" height="18" background="${img}/tab_14.gif" class="STYLE1"><div align="center" class="STYLE2 STYLE1">序号</div></td>
            <td width="7%" height="18" background="${img}/tab_14.gif" class="STYLE1"><div align="center" class="STYLE2">回复手机号码</div></td>
            <td width="10%" height="18" background="${img}/tab_14.gif" class="STYLE1"><div align="center" class="STYLE2">短信内容</div></td>
            <td width="20%" height="18" background="${img}/tab_14.gif" class="STYLE1"><div align="center" class="STYLE2">回复时间</div></td>
            <td width="7%" height="18" background="${img}/tab_14.gif" class="STYLE1"><div align="center" class="STYLE2">删除</div></td>
          </tr>
          
          <c:forEach var="entity" items="${data.rows}" varStatus="status">
			 <tr>
	            <td height="18" bgcolor="#FFFFFF" class="STYLE2"><div align="center" class="STYLE2 STYLE1">${status.index+1}</div></td>
	           	<td height="18" bgcolor="#FFFFFF"><div align="center" class="STYLE2 STYLE1">${entity.phone}</div></td>
	           	<td height="18" bgcolor="#FFFFFF"><div align="center" class="STYLE2 STYLE1">${entity.message}</div></td>
	           	<td height="18" bgcolor="#FFFFFF"><div align="center" class="STYLE2 STYLE1">${entity.createTimeName}</div></td>
	            <td height="18" bgcolor="#FFFFFF"><div align="center"><span class="STYLE2"><img src="${img}/010.gif" width="9" height="9" /> </span><span class="STYLE1">[</span><a href="#" onclick="deleteMethod('${entity.id}');">删除</a><span class="STYLE1">]</span></div></td>
	          </tr>
          </c:forEach>
          
        </table></td>
        <td width="9" background="${img}/tab_16.gif">&nbsp;</td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td height="29"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="15" height="29"><img src="${img}/tab_20.gif" width="15" height="29" /></td>
        <td background="${img}/tab_21.gif"><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="25%" height="29" nowrap="nowrap">
            <input type="hidden" name="page" id="page" value="${page}"/>
            <input type="hidden" name="pageSize" id="pageSize" value="${data.pageSize}"/>
            <input type="hidden" name="lastPage" id="lastPage" value="${data.lastPage}"/>
            <span class="STYLE1">共${data.total}条纪录，当前第${page}/${data.lastPage}页，每页${data.pageSize}条纪录</span></td>
            <td width="75%" valign="top" class="STYLE1"><div align="right">
              <table width="352" height="20" border="0" cellpadding="0" cellspacing="0">
                <tr>
                  <td width="62" height="22" valign="middle"><div align="right"><img src="${img}/first.gif" width="37" height="15" onclick="toPage('0');"/></div></td>
                  <td width="50" height="22" valign="middle"><div align="right"><img src="${img}/back.gif" width="43" height="15" onclick="toPage('1');"/></div></td>
                  <td width="54" height="22" valign="middle"><div align="right"><img src="${img}/next.gif" width="43" height="15" onclick="toPage('2');"/></div></td>
                  <td width="49" height="22" valign="middle"><div align="right"><img src="${img}/last.gif" width="37" height="15" onclick="toPage('3');"/></div></td>
                  <td width="150" height="22" valign="middle"></td>
                </tr>
              </table>
            </div></td>
          </tr>
        </table></td>
        <td width="14"><img src="${img}/tab_22.gif" width="14" height="29" /></td>
      </tr>
    </table></td>
  </tr>
</table>
</form>
</body>
</html>